<?php

include_once dirname(dirname(__FILE__)) . '/include/common.php';
$core = new core();
$payment_id = isset($_POST["payment_id"]) ? intval($_POST["payment_id"]) : 0;
$payment_data = $core->getPaymentById($payment_id);
if ($payment_data) {
    $payment = $payment_data->payment/1000;
    echo json_encode(array('type' => 0, 'id'=>$payment_data->id,'payment' => $payment,
        'type_payment' => $payment_data->type_payment,'description'=>$payment_data->description,'payment_date'=>date('d-m-Y', strtotime($payment_data->date_payment))));
    die;
} else {
    echo json_encode(array('type' => 1, 'msg' => "Payment không tồn tại!"));
    die;
}
?>
